#include <iostream>
#include <bits/stdc++.h>
#include <memory>

using namespace std;

class A{
public:
    int mode;
    void pubilc_change();
private:
    void change(int x){
        mode = x;
    }
};

class B : public A{
public:
    using A::pubilc_change; //using 可以直接拿来父类的函数
   
};
class C : public B{
public:
    using A::pubilc_change;
};
class Quote{
public:
    string isbn() const{ return "";}
    virtual Quote* clone() const&{return new Quote(*this);};
    virtual Quote* clone() && {
        return new Quote(std::move(*this));
    }
};

class Bulk_Quote : public Quote{
    Bulk_Quote* clone() const& { return new Bulk_Quote(*this);}
    Bulk_Quote* clone() &&{
        return new Bulk_Quote(std::move(*this));
    }
};

class Basket{
private:
    void add_item(const std::shared_ptr<Quote> &sale){
        items.insert(std::shared_ptr<Quote>(sale->clone())); //由于不知道sale是继承体系中的哪个类 所以要在定义了虚函数之后使clone()方法
    }
    void add_item(const Quote& rhs){
        items.insert(shared_ptr<Quote>(rhs.clone()));
    }
    void add_item(Quote&& rhs){
        items.insert(shared_ptr<Quote>(std::move(rhs).clone()));
    }
    double total_receipte(std::ostream&) const;
private:
    static bool cpm(const shared_ptr<Quote>& lhs, const shared_ptr<Quote>& rhs){
        return lhs->isbn() < rhs->isbn();
    }
    std::multiset<std::shared_ptr<Quote> , decltype(cpm)*> 
    items{cpm};
};
double print_total(...){}
double Basket::total_receipte(ostream& os) const{
    double sum = 0.0;

    for(auto iter = items.begin() ; iter != items.end() ; iter = items.upper_bound(*iter)){
        sum += print_total(os,**iter,items.count(*iter));
    }
    os ;

    return sum;
}

class Base{
public:
    int x ;
    
};
class Derive : public Base{
public:    
    int y;
    Derive* virtual_copy(shared_ptr<Base> &rhs);
};
Derive* Derive::virtual_copy(shared_ptr<Base> &rhs){
    auto it = new decltype(*rhs);
}

//Just for copying
int main(int argc, char const *argv[])
{
    Basket bsk;

        // bsk.add_item(make_shared<Quote>(...));`11111
    
    return 0;
}
